{% load i18n %}
{% load url from suit_compat %}
<ul class="breadcrumb">
    <li>
        <a href="{% url 'admin:index' %}" title="{% trans "Go back to admin homepage" %}">{% trans "Home" %}</a>
        <span class="divider">&raquo;</span></li>
    <li>
        <a href="{% url 'admin:index' %}filer/" title="{% trans "Go back to Filer app" %}"> {% trans "Filer" %}</a>
    </li>
    {% if instance.is_root and not instance.is_smart_folder %}{% else %}
        <li><span class="divider">&raquo;</span>
            <a href="{% url 'admin:filer-directory_listing-root' %}" title="{% trans "Go back to root folder" %}">{% trans "root" %}</a>
        </li>{% endif %}

    {% for ancestor_folder in instance.logical_path %}
        <li><span class="divider">&raquo;</span>
            <a href="{{ ancestor_folder.get_admin_directory_listing_url_path }}" title="{% blocktrans with ancestor_folder.name as folder_name %}Go back to '{{ folder_name }}' folder{% endblocktrans %}">
                {% if ancestor_folder.label %}{{ ancestor_folder.label }}{% else %}{{ ancestor_folder.name }}{% endif %}</a>
        </li>
    {% endfor %}
    {% if breadcrumbs_action %}
        <li><span class="divider">&raquo;</span>
            <a href="{{ instance.get_admin_directory_listing_url_path }}" title="{% blocktrans with instance.name as folder_name %}Go back to '{{ folder_name }}' folder{% endblocktrans %}">
                {% if instance.label %}{{ instance.label }}{% else %}{{ instance.name }}{% endif %}</a>
        </li>
        <li class="active"><span class="divider">&raquo;</span> {{ breadcrumbs_action }}</li>

    {% else %}
        <li class="active"><span class="divider">&raquo;</span>
            {% if instance.label %}{{ instance.label }}{% else %}{{ instance.name }}{% endif %}
        </li>
    {% endif %}
</ul>
